
<template>
  <div>
    <el-tabs v-model="activeName" :before-leave="beforeLeave" class="tabs-self">
      <el-tab-pane label="引流链接列表" name="1">
        <leadLinks v-if="activeName == 1" />
      </el-tab-pane>
      <el-tab-pane label="获客助手链接列表" name="2">
        <link-assistant v-if="activeName == 2"></link-assistant>
      </el-tab-pane>
      <el-tab-pane name="3">
        <span slot="label">
          <el-button type="primary" icon="el-icon-plus" @click="goRoute" v-hasPermi="['admin:link:add']" size="mini">创建链接</el-button>
        </span>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import leadLinks from './leadLinks'
import linkAssistant from './linkAssistant'
export default {
  name: 'WelcomeMessageSeeting',
  components: { leadLinks, linkAssistant },
  data() {
    return {
      activeName: '1',
    }
  },
  methods: {
    beforeLeave(visitName) {
      if (visitName == 3) return false
    },
    // 创建链接
    goRoute() {
      this.$router.push({
        name: "AddDrainageLink",
      });
    },
  }
}
</script>
<style lang="scss" scoped>
.tabs-self {
  ::v-deep .el-tabs__nav {
    width: 100%;
  }
  ::v-deep #tab-3 {
    float: right;
    right: 7px;
  }
}
</style>
